"""
URL configuration for maintenance_system project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/5.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from . import views
from reports.views import report_dashboard

urlpatterns = [
    path('', views.home, name='home'),
    path('dashboard/', views.dashboard, name='dashboard'),
    path('dashboard/customer/', views.dashboard_customer, name='dashboard_customer'),
    path('dashboard/technician/', views.dashboard_technician, name='dashboard_technician'),
    path('dashboard/admin/', views.dashboard_admin, name='dashboard_admin'),
    path('dashboard/receptionist/', views.dashboard_receptionist, name='dashboard_receptionist'),
    path('dashboard/quality-checker/', views.dashboard_quality_checker, name='dashboard_quality_checker'),
    path('reports/', report_dashboard, name='reports'),
    path('tickets/', include('tickets.urls')),
    path('assets/', include('assets.urls')),
    path('users/', include('users.urls')),
    path('notifications/', include('notifications.urls')),
    path('spare-parts/', include('spare_parts.urls')),
    path('admin/', admin.site.urls),
    path('accounts/', include('django.contrib.auth.urls')),
]

# 在开发环境中提供media文件服务
if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
